<template>
    <div style="background: #fff" v-loading="pdfLoading">
        <el-form :model="form">
            <div class="smallBox">
                <span class="viewPDF">#1 <u @click="openPdf(1)">View PDF</u></span>
                <el-form-item prop="answer0">
                        <div style="width: 45%;line-height: 20px">Does this claim require an attachment and/or narrative?</div>
                        <el-select ref="sub0" v-model="form.answer0" placeholder="" style="position: absolute;top:0px;margin-left: 45%">
                            <el-option label="Yes" value="0"></el-option>
                            <el-option label="No" value="1"></el-option>
                        </el-select>
                </el-form-item>
                <el-form-item prop="answer1" class="mt20">
                    <p style="width: 45%;line-height: 20px;">If yes,why and what would you attach?</p>
                    <el-input style="resize:none;width: 30%;position: absolute;top:10px;margin-left: 45%;height: 50px" type="textarea" v-model="form.answerText0"></el-input>
                </el-form-item>
            </div>
        </el-form>
        <el-dialog :title="titleName" :visible.sync="pdfVisible">
            <pdf :src="pdfSrc"></pdf>
            <span slot="footer">
                <el-button class="grayBtn" @click="pdfVisible=false">Close</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<script>
    //import pdfSrc from "../../assets/file/ClaimFormExam/Claim1.pdf"
     import pdf from 'vue-pdf'
    export default {
        name: "claimFormExam",
        components:{pdf},
        data(){
            return{
                pdfVisible:false,
                pdfLoading:false,
                pdfSrc:'',
                titleName:'',
                form:{
                    answer0:'',
                    answerText0:'',
                    answer1:'',
                    answer2:'',
                    answer3:'',
                    answer4:'',
                    answer5:'',
                    answer6:'',
                }
            }
        },
        methods:{
            openPdf(index){
                this.pdfVisible=true
                this.titleName="Claim"+index+".pdf"
                this.pdfSrc=require('../../assets/file/ClaimFormExam/Claim'+index+'.pdf')

            },

        }
    }
</script>

<style scoped>
    .el-select >>> .el-input{
        width: 68px;
    }
    .el-select >>> .el-input .el-input__inner{
        background: #fff!important;
        font-size: 12px!important;
        line-height: 40px!important;
        border-radius: 0px!important;
        height: 30px!important;
    }
    .el-select >>> .el-input .el-input__icon{
        width: 15px!important;
    }
</style>